package com.woniuxy.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer{
    @Resource
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).
                excludePathPatterns("/page/index.html","/js/**","/css/**","/account/login","/account/register","/account/sendCode","/account/check/**","/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**").//白名单
                addPathPatterns("/**");//拦截地址
    }
}
